Every property in a NHibernate model must have a data type, which you configure through the Data Type drop-down in the Properties window. Most standard NHibernate data types and .NET primitive types are supported out of the box. If you need to add your own custom data types, you can do so via the NHibernate Model Explorer. Custom data types appear in the Data Type drop-down and can be selected for properties just like built-in data types.

To open the NHibernate Model window if it’s not already open, choose View > Other Windows > NHibernate Model. The window displays a tree view of your model.

Enums

To map an integer column as a user-defined enum type, right-click the Model node at the root of the tree view, and choose Add New Enum Type. Enter the following information:

User Mapped Types

To map a column using a custom mapping (a NHibernate IUserType mapping), right-click the Model node at the root of the tree view, and choose Add New User Mapped Type. Enter the following information.